#include <QApplication>
#include <QQmlApplicationEngine>
#include <QtQml>
#include "device.h"
#include "Network/tcpsocket.h"
#include "Network/udpsocket.h"

//baidu voice
#include "audiorecorder.h"
#include "baiduvoice.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QQmlApplicationEngine engine;
    Device device;
    TcpSocket tcpSocket;
    UdpSocket udpSocket;
    AudioRecorder ar;
    BaiduVoice bv;

    qmlRegisterType<UdpSocket>("UdpSocket",1,0,"MUdpSocket");
    engine.rootContext()->setContextProperty("Device",&device);
    engine.rootContext()->setContextProperty("TcpSocket",&tcpSocket);
    engine.rootContext()->setContextProperty("UdpSocket",&udpSocket);
    engine.rootContext ()->setContextProperty ("AudioRecorder",&ar);
    engine.rootContext ()->setContextProperty ("BaiduVoice",&bv);
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));



    return app.exec();
}
